package com.itheima.demo01;

import java.io.*;

public class ByteBufferStream {
    public static void main(String[] args) throws IOException {
        //字节缓存流

        //创建读取文件缓冲流对象
        BufferedInputStream bis = new BufferedInputStream(new FileInputStream("a.txt"));

        //创建写入文件缓冲流对象
        BufferedOutputStream bos = new BufferedOutputStream(new FileOutputStream("copya.txt"));

        byte[] bytes = new byte[1024];    //指定一次读取1024个字节

        int len;
        while ((len = bis.read(bytes)) != -1) {
            bos.write(bytes, 0, len);
        }

        bis.close();
        bos.close();




    }
}
